<template>
  <div>
		<BreadCrumb />
		<section v-if="tableData.length" class="question-list">
			<QuestionItem
				v-for="(item, index) in tableData"
				:key="index"
				:question="item" />
		</section>
		<el-pagination
			background
			layout="prev, pager, next"
			v-model:current-page="params.pageNo"
			:page-count="pages"
			@current-change="getTableData"/>
  </div>
</template>

<script setup>
import BreadCrumb from '@@/menu/breadcrumb'
import { ref, reactive } from 'vue'
import { get } from '@/axios'
import QuestionItem from '@@/question/item'
const tableData = ref([])
const pages = ref(0)
const params = reactive({
	pageNo: 1,
	pageSize: 6
})
getTableData()
function getTableData () {
	get('/questions/list', params, content => {
		tableData.value = content.records
		pages.value = content.pages
	})
}
</script>

<style scoped lang="scss">
</style>